Mon Oct 31, 2016

Recall

Recall from last lecture we studied

  • Random sampling: where we select the sample from the population in an unbiased fashion
  • Bias: A sample is biased if some observational units have a higher probability of being included in the sample.

Keywords: random and probability

Probability

Probability in History

In 79 AD a volcanic eruption in the Roman city of Pompeii covered the entire city in hot ash, perfectly preserving may items:

Drawing

Probability in History

including…

Drawing

Two Approaches to Probability

There are two way to approaches to studying probability:

Mathematically (MATH 310) Simulations
Drawing Drawing

Simulations via Computer

  • The mathematical approach to studying probability requires more mathematical background: set theory, discrete math, calculus, and later on measure theory.
  • The simulation approach does not. Instead we requires a computer's random number generator to generate simulations. Why?

Simulations via Computer

Doing this repeatedly by hand is tiring:

DrawingDrawingDrawingDrawingDrawingDrawingDrawing DrawingDrawingDrawingDrawingDrawingDrawingDrawing DrawingDrawingDrawingDrawingDrawingDrawingDrawing DrawingDrawingDrawingDrawingDrawingDrawingDrawing DrawingDrawingDrawingDrawingDrawingDrawingDrawing DrawingDrawingDrawingDrawingDrawingDrawingDrawing

Critical Note

The "random simulation" in question is not limited to coin flips.

Analogy for Random Simulation

For any random simulation, think to this: POWERBALL

Drawing

Analogy for Random Simulation

We run different simulations by tinkering with the Powerball:

  • Balls:
    • How many balls do you have?
    • What are written on the balls?
    • Do the balls have equal probability of being picked?
  • Drawing balls:
    • How are you drawing the balls
    • How many balls do you pick?
    • What are you recording from each ball?
    • What to do with a ball after you've picked/recorded it?
  • Number of lotteries:
    • How many times do you repeat the lottery?

Analogy for Random Simulation

## Loading required package: lattice
## Loading required package: mosaicData
## Loading required package: Matrix
## 
## Attaching package: 'Matrix'
## The following object is masked from 'package:tidyr':
## 
##     expand
## 
## The 'mosaic' package masks several functions from core packages in order to add additional features.  
## The original behavior of these functions should not be affected by this.
## 
## Attaching package: 'mosaic'
## The following object is masked from 'package:Matrix':
## 
##     mean
## The following objects are masked from 'package:dplyr':
## 
##     count, do, tally
## The following objects are masked from 'package:stats':
## 
##     binom.test, cor, cov, D, fivenum, IQR, median, prop.test,
##     quantile, sd, t.test, var
## The following objects are masked from 'package:base':
## 
##     max, mean, min, prod, range, sample, sum
## 
## Flipping 1 coin [ Prob(Heads) = 0.5 ] ...
## 
## T
## 
## Number of Heads: 0 [Proportion Heads: 0]
## 
## Flipping 10 coins [ Prob(Heads) = 0.5 ] ...
## 
## H H T T H H H H T T
## 
## Number of Heads: 6 [Proportion Heads: 0.6]
## # A tibble: 10 × 4
##        n heads tails  prop
##    <dbl> <dbl> <dbl> <dbl>
## 1     10     6     4   0.6
## 2     10     7     3   0.7
## 3     10     4     6   0.4
## 4     10     6     4   0.6
## 5     10     5     5   0.5
## 6     10     4     6   0.4
## 7     10     3     7   0.3
## 8     10     4     6   0.4
## 9     10     6     4   0.6
## 10    10     5     5   0.5
## # A tibble: 5 × 2
##   heads count
##   <dbl> <int>
## 1     3     1
## 2     4     3
## 3     5     2
## 4     6     3
## 5     7     1
##   n heads tails prop
## 1 1     0     1    0
## 2 1     0     1    0
## 3 1     1     0    1
##   V1 V2 V3 V4 V5 V6
## 1  2  1  3  1  2  2
## 2  1  2  1  2  2  1
## 3  6  3  1  6  6  5
##   V1 V2 V3 V4 V5 V6
## 1  5  4  2  1  6  3
## 2  3  6  2  4  1  5
## 3  2  3  4  6  1  5